package momo.multitree.structure;

import java.util.HashMap;

/**
 * Datastore that, given a pair of nodes, stores some double value 
 * @author krz
 *
 */
public class NodePair
{
	private HashMap<String, Double> pair;
	
	public NodePair()
	{
		pair = new HashMap<String, Double>();
	}
	
	public void setPair( Node from, Node to, double value )
	{
		pair.put(from.getId()+","+to.getId(), value);
	}
	
	public double getPair( Node from, Node to )
	{
		String key = from.getId()+","+to.getId();
		if ( !pair.containsKey(key) )
			return 0;
		return pair.get(key);
	}
}
